<cfif isDefined('form.fieldnames')>
	<cfoutput><cfdump var="#form#"></cfoutput>
<cfelse>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.autoSave.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script type="text/javascript" src="/js/dDumper.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(":input").autoSave(function(){
		var ele = new Object();
		ele[this.name] = (this.type =="checkbox") ? $(this).val() + "|" + this.checked:this.value;
		$.post("autosave_example.cfm", ele, function(data){$("#Result").empty().append(data);})
	});
	
<!---	sDumper($("#test").validate());--->
});
</script>
<h3>autoSave Demo</h3>
<hr />
<form id="test" Name="test">
	<table>
		<tr>
			<td><input name="testText" type="text" value="" /></td>
		</tr>
		<tr>
			<td><textarea name="testTextarea" cols="20" rows="3">Start typing!</textarea></td>
		</tr>
		<tr>
			<td><input name="testCheckbox" type="checkbox" value="I'm number 1" /></td>
		</tr>
		<tr>
			<td><input name="testCheckbox" type="checkbox" value="I'm number 2" /></td>
		</tr>
		<tr>
			<td><input name="testRadio" type="radio" value="I'm number 1" checked /></td>
		</tr>
		<tr>
			<td><input name="testRadio" type="radio" value="I'm number 2"  /></td>
		</tr>
		<tr>
			<td><select name="testSelect" size="1">
				<option value="I'm option 1">Pick me!</option>
				<option value="I'm option 2">Pick me!</option>
			</select></td>
		</tr>
		<tr>
			<td><select name="testMultiSelect" multiple="multiple" size="3">
				<option value="I'm option 1">Pick me!</option>
				<option value="I'm option 2">Pick me!</option>
			</select></td>
		</tr>
	</table>
</form>
<hr />
<div id="Result"></div>
</cfif>